package controllers

import (
	"echoDev/frans"
	"github.com/labstack/echo"
	"net/http"
)

type IndexController struct {
	*frans.GormAdapter
	BaseController
}

func NewIndexController() *IndexController {
	return &IndexController{}
}

func (this *IndexController) Index(c echo.Context) error {

	//user := models.UserModel{}
	//this.Table("users").Where("id=?", 1).Find(&user)

	//user := []models.UserModel{}
	//this.Table("users").Where("id IN(?)", []int{1,2}).Find(&user)

	return c.String(http.StatusOK, "Index")
}

func (this *IndexController) Show(context echo.Context) error {
	return context.String(http.StatusOK, "index show ....")
}

func (this *IndexController) Route(g *echo.Group) {
	g.GET("/", this.Index)
	g.GET("/zxc", this.Show)
}
